//图片集合

const mongoose = require("mongoose");
//创建类 集合约束
const ImgSchema = new mongoose.Schema({
  //广告标题
  advTitle: {
    type: String,
    required: true,
  },
  //广告类型
  advType: {
    type: Number,
    required: true,
  },
  //广告排序
  advOrder: {
    type: Number,
    required: true,
  },
  //图片地址
  advHref: {
    type: String,
    required: true,
  },
  //添加时间
  addTime: {
    type: String,
    required: true,
    default: new Date().toLocaleString(),
  },
  //更新时间
  upTime: {
    type: String,
    required: true,
    default: "--",
  },
});

//创建集合
const advModel = mongoose.model("advList", ImgSchema);
module.exports = advModel;
